package vn.com.pavibook.model.vo;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 
 * @author QuangMinh
 */
public class PublisherVO implements Serializable {
	private static final long serialVersionUID = 1L;
	private Integer id;
	
	@NotEmpty(message = "Nhập thông tin")
	@Size(max=255, message = "Tên không quá 225 ký tự")
	private String name;
	
	private String title;
	
	@NotEmpty(message = "Nhập thông tin")
	@Size(max=255)
	private String address;
	
	private String bossName;
	
	@NotEmpty(message = "Nhập thông tin")
	private String phone;
	
	@NotEmpty(message = "Nhập thông tin")
	@Email (message = "Email không đúng (Ví dụ: abc@example.com)")
	private String emailBussiness;
	
	@NotEmpty(message = "Nhập thông tin")
	private String username;
	
	@NotEmpty(message = "Nhập thông tin")
	@Size(min = 8, max = 150, message="Nhập password ít nhất 8 ký tự")
	private String password;
	
	private String description;
	
	private int accountId;
	
	
	private Date registerDate;
	
	private boolean active;

	public PublisherVO() {
	}

	public PublisherVO(Integer id) {
		this.id = id;
	}

	public PublisherVO(Integer id, String name, String title, String address,
			String bossName, String phone, String emailBussiness,
			int accountId, Date registerDate, boolean active, String description) {
		this.id = id;
		this.name = name;
		this.title = title;
		this.address = address;
		this.bossName = bossName;
		this.phone = phone;
		this.emailBussiness = emailBussiness;
		this.accountId = accountId;
		this.registerDate = registerDate;
		this.active = active;
		this.description = description;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getBossName() {
		return bossName;
	}

	public void setBossName(String bossName) {
		this.bossName = bossName;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmailBussiness() {
		return emailBussiness;
	}

	public void setEmailBussiness(String emailBussiness) {
		this.emailBussiness = emailBussiness;
	}

	public int getAccountId() {
		return accountId;
	}

	public void setAccountId(int accountId) {
		this.accountId = accountId;
	}

	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	public boolean getActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof PublisherVO)) {
			return false;
		}
		PublisherVO other = (PublisherVO) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "vn.com.iflex.Publisher[ id=" + id + " ]";
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
